#!/bin/bash
morse_dir="/path/morse"
echo "解压文件 -- 20250108_morse.tar"
tar -xvf 20250108_morse.tar
cd 20250108_morse
echo "加载镜像"
docker load -i rongshu_167_images.tar
echo "复制 docker-compose.yml文件和 config.yaml"
cp docker-compose.yml.166 $morse_dir
cp config.yaml.166 $morse_dir/conf
echo "停止原有服务并备份"
cd $morse_dir
docker-compose down
echo "备份docker-compose 文件"
cp docker-compose.yml docker-compose.yml.1.52.0.$(date +%Y%m%d%H%M%S)
cp conf/config.yaml conf/config.yaml.1.52.0.$(date +%Y%m%d%H%M%S)
echo "替换新文件"
cat docker-compose.yml.167 > docker-compose.yml
cat conf/config.yaml.167 > conf/config.yaml
echo "启动服务"
docker-compose up -d
sleep 10
echo "`curl -k https://localhost/prod/ping`"